package com.hibernate.db.model;

// Generated 21.01.2013 15:52:18 by Hibernate Tools 3.4.0.CR1

import static javax.persistence.GenerationType.IDENTITY;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.NamedQueries;
import org.hibernate.annotations.NamedQuery;

/**
 * Label generated by hbm2java
 */
@NamedQueries({
	@NamedQuery(
	name = "getLabelForVocabularyByLang",
	query = "from Label l where l.vocabulary = :vocID and l.language = :langID"
	)
})
@Entity
@Table(name = "label", catalog = "learning")
public class Label implements java.io.Serializable {

	private Integer id;
	private Language language;
	private Vocabulary vocabulary;
	private String word;
	private String example;
	private String wordtype;
	private String soundPath;
	private byte[] soundFile;

	public Label() {
	}

	public Label(Language language, Vocabulary vocabulary, String word,
			String example, String wordtype, String soundPath, byte[] soundFile) {
		this.language = language;
		this.vocabulary = vocabulary;
		this.word = word;
		this.example = example;
		this.wordtype = wordtype;
		this.soundPath = soundPath;
		this.soundFile = soundFile;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "id", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "languageId")
	public Language getLanguage() {
		return this.language;
	}

	public void setLanguage(Language language) {
		this.language = language;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "vocabularyId")
	public Vocabulary getVocabulary() {
		return this.vocabulary;
	}

	public void setVocabulary(Vocabulary vocabulary) {
		this.vocabulary = vocabulary;
	}

	@Column(name = "word", length = 100)
	public String getWord() {
		return this.word;
	}

	public void setWord(String word) {
		this.word = word;
	}

	@Column(name = "example", length = 200)
	public String getExample() {
		return this.example;
	}

	public void setExample(String example) {
		this.example = example;
	}

	@Column(name = "wordtype", length = 1)
	public String getWordtype() {
		return this.wordtype;
	}

	public void setWordtype(String wordtype) {
		this.wordtype = wordtype;
	}

	@Column(name = "soundPath", length = 100)
	public String getSoundPath() {
		return this.soundPath;
	}

	public void setSoundPath(String soundPath) {
		this.soundPath = soundPath;
	}

	@Column(name = "soundFile")
	public byte[] getSoundFile() {
		return this.soundFile;
	}

	public void setSoundFile(byte[] soundFile) {
		this.soundFile = soundFile;
	}

}
